﻿using System.Collections.Generic;
using FizzWare.NBuilder;

namespace IslandUnit.Providers
{
    /// <summary>
    /// Builder provider for NBuilder.
    /// </summary>
    public class NBuilderProvider : BuilderProviderBase
    {
        /// <summary>
        /// Creates a list of itens of the indicated type.
        /// </summary>
        /// <typeparam name="TPoco">The type of the itens in list.</typeparam>
        /// <param name="itensToBuild">The number of itens to be created.</param>
        /// <returns>A list of itens</returns>
        public override IList<TPoco> CreateList<TPoco>(int itensToBuild)
        {
            return Builder<TPoco>.CreateListOfSize(itensToBuild).Build();
        }

        /// <summary>
        /// Creates a item of the indicated type.
        /// </summary>
        /// <typeparam name="TPoco">The type of the item.</typeparam>
        /// <returns>One item.</returns>
        public override TPoco CreateOne<TPoco>()
        {
            return Builder<TPoco>.CreateNew().Build();
        }
    }
}
